package com.ychong.ychongwidget.ui

import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import com.ychong.ychongwidget.R
import com.ychong.ychongwidget.databinding.ActivityYchPlateInputViewBinding

class YCHPlateInputViewActivity:AppCompatActivity() {
    private var binding: ActivityYchPlateInputViewBinding?=null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = DataBindingUtil.setContentView(this, R.layout.activity_ych_plate_input_view)

        binding!!.inputEt.addTextChangedListener(object : TextWatcher{
            override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {

            }

            override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
                binding!!.ychPlateView.input(s.toString())
            }

            override fun afterTextChanged(s: Editable?) {

            }

        })
    }
}